package com.rui.patterns.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : [锐神NO.3]
 * @version : [v1.0]
 * @className : Waitor
 * @createTime : [2022/2/23 18:10]
 * @description : [描述该类的功能]
 */

public class Waiter {

    private List<Command> commands = new ArrayList<>();

    public void setCommand(Command command) {
        commands.add(command);
    }

    public void orderUp(){
        System.out.println("美女服务员：接到客人的订单，开始为您服务");
        for (Command command : commands) {
            if(command != null){
                command.execute();
            }
        }
    }
}
